﻿namespace Leetcode.N0300;

public class Solution
{
    public int LengthOfLIS(int[] nums)
    {
        if (nums.Length == 0)
        {
            return 0;
        }

        var max = new int[nums.Length];
        max[0] = 0;
        for (var i = 1; i < nums.Length; i++)
        {
            for (int j = 0; j < i; j++)
            {
                if (nums[i] > nums[j])
                {
                    max[i] = Math.Max(max[j] + 1, max[i]);
                }
            }
        }
        return max.Max(_ => _) + 1;
    }
}
